import React, { Component } from 'react'
import { Switch, Route, Redirect } from 'react-router-dom'

export default class RightMain extends Component {
  render() {
    const { routeChildren } = this.props
    return (
      <div style={{ height: 'calc(100% - 48px)', border: '1px solid red' }}>
        {
          <Switch>
            {routeChildren.map((r) => (
              <Route
                key={r.path}
                path={r.path}
                exact={r.exact}
                render={(props) => (
                  <r.component
                    {...props}
                    routeChildren={r.routeChildren}
                  ></r.component>
                )}
              ></Route>
            ))}
            <Redirect to="/404"></Redirect>
          </Switch>
        }
      </div>
    )
  }
}
